package com.xx.mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.UUID;

@Mapper(imports = UUID.class)
public interface DemoMap {

    DemoMap INSTANCE = Mappers.getMapper(DemoMap.class);

    Target tar(Resource src);

    @Mappings({
            @Mapping(source = "name", target = "name2"),
            @Mapping(target = "status", expression = "java(UUID.randomUUID().toString())"),
    })
    Target2 tar2(Resource src);

}
